import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import VeeValidate from "vee-validate";
import helper from "./lib/helper.js";

import "./lib/hotcss/hotcss.js"; // 引入移动端缩放适应文件
import "mint-ui/lib/style.css"; // 引入mint-ui的样式文件

// 按需引入MintUI需配置.babelrc/babek.config.js文件

Vue.config.productionTip = false;

// 加入表单校验插件
Vue.use(VeeValidate);
// 全局路由守卫
router.beforeEach((to, from, next) => {
  if (to.path != "/") {
    if (helper.getType(store.getters.getLoginUser) === "Object") {
      next();
    } else {
      next("/");
    }
  } else {
    next();
  }
});
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
